/**
 * @author 黄波
 * 创建日期：2011Oct 7, 2011
 * TODO// N/A
 */
package com.platform.res.action;

import java.util.List;

import com.platform.pojo.ResInfo;
import com.platform.pojo.ResType;
import com.platform.res.bo.ResBo;

/**
 * 获得资源信息（用于更新类型）
 */
public class GetResInfoForUpdateAction extends ResourceSupport {

	private ResInfo item;
	private String id;
	private ResType type;
	public ResType getType() {
		return type;
	}
	public void setType(ResType type) {
		this.type = type;
	}
	public ResInfo getItem() {
		return item;
	}
	public void setItem(ResInfo item) {
		this.item = item;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	@Override
	public String execute() throws Exception {
		if(id == null || id.equals("")) {
			return ERROR;
		}
		ResBo bo = ResBo.getInstance();
		item = bo.getInfo(id);
		type = bo.getType(item.getTypeId().toString());
		return SUCCESS;
	}
	
}
